package com.hy.mydesktop.client.mvc.core.builder;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.hy.mydesktop.client.component.type.ComponentControllerEnum;
import com.hy.mydesktop.shared.persistence.domain.gxt.GxtComponentControllerMetaNodeModel;
import com.hy.mydesktop.shared.persistence.domain.gxt.GxtComponentMetaNodeModel;
import com.hy.mydesktop.shared.persistence.domain.gxt.constant.MetaDataConstants;

public class MenuBarBuilderTemplate {

	public static GxtComponentControllerMetaNodeModel createMenuBarBuilderTemplate(
			Map<String, Object> map1, Map<String, Object> map2) {

		Map<String , Object> menuBarController=new HashMap<String, Object>();
		menuBarController.put("component_controller_model_type", ComponentControllerEnum.MENUBAR_CONTROLLER_MODEL);
		menuBarController.put("component_controller_model_type_index", ComponentControllerEnum.MENUBAR_CONTROLLER_MODEL.ordinal());
		
	
		//menuBarController.put(MetaDataConstants.GXT_COMPONENT__METANODEMODEL, this.getMenuBarGxtComponentMetaNodeModel());		
		//node3.setRegisterEventTypes(node3.addGxtAppEventType("0301"));
		GxtComponentControllerMetaNodeModel node3=new GxtComponentControllerMetaNodeModel(menuBarController);
		node3 = ControllerAndComponentMetaNodeModelCreationTemplate.buildCommonAttributes(node3,map1);
		if (map1.get(MetaDataConstants.COMPONENT_CONTROLLER_METAMODEL_ID)!=null) {	
			String controllerMetaModelId=(String)map1.get(MetaDataConstants.COMPONENT_CONTROLLER_METAMODEL_ID);
			String id="menuBarController_"+controllerMetaModelId;
			node3.setId(id);
			node3.setControllerMetaNodeModelId(id);
		}else {
			throw new RuntimeException("xxxxxxxxxxxxx");
		}
		
		map2.put(MetaDataConstants.COMPONENT_CONTROLLER_METAMODEL_ID, node3.getControllerMetaNodeModelId());
		
		
//		GxtComponentMetaNodeModel gxtComponentMetaNodeModel =this.getMenuBarGxtComponentMetaNodeModel(map2);
		
		
//		node3.setGxtComponentMetaNodeModel(gxtComponentMetaNodeModel);
		return node3;

	}

}
